#ifndef MYPUSHBUTTON_H
#define MYPUSHBUTTON_H

#include <QPushButton>
#include <QMouseEvent>
class MyPushButton : public QPushButton
{
    Q_OBJECT
private:
    bool isAnimation = false; // 判断是否在做动画
    void animation(bool flag);
public:
    explicit MyPushButton(QWidget *parent = nullptr);
    MyPushButton(QString normalImg,QString pressImg = "");
    QString normalImgPath; // 默认显示图片的路径
    QString pressImgPath;  // 按下显示图片的路径
    void jump(); // 跳跃
    void down(); // 落下
    void mousePressEvent(QMouseEvent *ev);
    void mouseReleaseEvent(QMouseEvent *ev);

signals:

};

#endif // MYPUSHBUTTON_H
